package com.ssmIntegration.utils;

import lombok.Data;

@Data
public class R {

    // 200成功状态码
    private int code = 200;

    // 返回状态
    private boolean flag = true;

    // 返回具体数据
    private Object data;

    public static R ok(Object data) {
        R r = new R();
        r.data = data;
        return r;
    }

    public static R fail(Object data) {
        R r = new R();
        // 错误码
        r.code = 500;
        // 错误状态
        r.flag = false;
        r.data = data;
        return r;
    }




}
